{% extends "base.htm" %}
{% block header_title %}网站设置 - 后台管理页面{% end %}

{% block body %}
<div class="am-cf admin-main">
  {% include "sidebar.htm" %}

  <!-- content start -->
  <div class="admin-content">

    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">首页</strong> /
          <small>网站设置</small></div>
    </div>

    <div class="am-g">

      <div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">
        <div class="am-panel am-panel-default">
          <div class="am-panel-bd">
            <div class="am-g">
              <div class="am-u-lg-12">
                <p class="am-text-sm">网站设置</p>
                <button class="am-btn am-btn-secondary" id="create-key">生成加密密钥</button>
              </div>
            </div>
          </div>
        </div>

      </div>

      <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
        <form class="am-form am-form-horizontal" method="post" action="/admin/setting">
          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">网站名</label>
            <div class="am-u-sm-9">
              <input name="webname" type="text" value="{{ site['webname'] }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">加密密钥</label>
            <div class="am-u-sm-9">
              <input name="key" type="text" value="" placeholder="不修改请不要填写">
              <small>重新设置后网站所有用户将需要重新登录</small>
            </div>
          </div>

          <div class="am-form-group" id="minos-checkbox">
            <label class="am-u-sm-3 am-form-label">验证码</label>
            <div class="am-u-sm-9">
                <label class="am-checkbox">
                  <input type="checkbox" name="captcha" value="register" data-am-ucheck {% if captcha['register'] %}checked{% end %}> 注册验证码
                </label>
                <label class="am-checkbox">
                  <input type="checkbox" name="captcha" value="login" data-am-ucheck {% if captcha['login'] %}checked{% end %}>
                  登录验证码
                </label>
                <label class="am-checkbox">
                  <input type="checkbox" name="captcha" value="comment" data-am-ucheck {% if captcha['comment'] %}checked{% end %}>
                  回复验证码
                </label>
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">初始金币</label>
            <div class="am-u-sm-9">
              <input name="init_money" type="text" value="{{ init_money }}" >
              <small>新用户注册后送金币</small>
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">注册设置</label>
            <div class="am-u-sm-9">
              <select name="register">
                  <option value="open" {% if register == 'on' %}selected{% end %}>开放注册</option>
                  <option value="invite" {% if register == 'invite' %}selected{% end %}>邀请注册</option>
                  <option value="close" {% if register == 'close' %}selected{% end %}>关闭注册</option>
              </select>
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">关键词</label>
            <div class="am-u-sm-9">
              <input name="keyword" type="text" value="{{ site['keyword'] }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">网站描述</label>
            <div class="am-u-sm-9">
              <textarea name="description" rows="5">{{ site['description'] }}</textarea>
            </div>
          </div>

          <div class="am-form-group">
            <div class="am-u-sm-9 am-u-sm-push-3">
              <button type="submit" class="am-btn am-btn-primary">保存修改</button>
            </div>
          </div>
          {% raw xsrf_form_html() %}
        </form>
      </div>
    </div>

  </div>
  <!-- content end -->

</div>

<a class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

{% end %}